/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import entities.Account;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author QUY_THI
 */
@ManagedBean
@SessionScoped
public class AllAccountsBean {
    @EJB
    private ChangeStatusLocal changeStatus;
    @EJB
    private AccountsLocal accounts;
    private Account selectAccount;

    public Account getSelectAccount() {
        return selectAccount;
    }

    public void setSelectAccount(Account selectAccount) {
        this.selectAccount = selectAccount;
    }
    private List<Account> list;

    public List<Account> getList() {
        return getAll();
    }

    /** Creates a new instance of AllAccountsBean */
    public AllAccountsBean() {
        list = new ArrayList<Account>();
    }

    public List<Account> getAll() {
        return accounts.getAllAccount();
    }

    public void changeAccount() {
        changeStatus.changeStatus(selectAccount);
    }

}
